home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / QD3DSet.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  9.5 KB  |  322 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3DSet.a
  3. ;
  4. ;    Contains:    Q3Set types and routines                                            
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
  19. __QD3DSET__ SET 1
  20.  
  21.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  22.     include 'QD3D.a'
  23.     ENDIF
  24.  
  25. ; ******************************************************************************
  26. ; **                                                                             **
  27. ; **                                Set Routines                                 **
  28. ; **                                                                             **
  29. ; ****************************************************************************
  30.  
  31. ;
  32. ; extern TQ3SetObject Q3Set_New(void )
  33. ;
  34.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  35.         IMPORT_CFM_FUNCTION Q3Set_New
  36.     ENDIF
  37.  
  38. ;
  39. ; extern TQ3ObjectType Q3Set_GetType(TQ3SetObject theSet)
  40. ;
  41.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  42.         IMPORT_CFM_FUNCTION Q3Set_GetType
  43.     ENDIF
  44.  
  45. ;
  46. ; extern TQ3Status Q3Set_Add(TQ3SetObject theSet, TQ3ElementType theType, const void *data)
  47. ;
  48.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  49.         IMPORT_CFM_FUNCTION Q3Set_Add
  50.     ENDIF
  51.  
  52. ;
  53. ; extern TQ3Status Q3Set_Get(TQ3SetObject theSet, TQ3ElementType theType, void *data)
  54. ;
  55.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  56.         IMPORT_CFM_FUNCTION Q3Set_Get
  57.     ENDIF
  58.  
  59. ;
  60. ; extern TQ3Boolean Q3Set_Contains(TQ3SetObject theSet, TQ3ElementType theType)
  61. ;
  62.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  63.         IMPORT_CFM_FUNCTION Q3Set_Contains
  64.     ENDIF
  65.  
  66. ;
  67. ; extern TQ3Status Q3Set_Clear(TQ3SetObject theSet, TQ3ElementType theType)
  68. ;
  69.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  70.         IMPORT_CFM_FUNCTION Q3Set_Clear
  71.     ENDIF
  72.  
  73. ;
  74. ; extern TQ3Status Q3Set_Empty(TQ3SetObject target)
  75. ;
  76.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  77.         IMPORT_CFM_FUNCTION Q3Set_Empty
  78.     ENDIF
  79.  
  80. ; *  Iterating through all elements in a set
  81. ; *
  82. ; *  Pass in kQ3ElementTypeNone to get first type
  83. ; *  kQ3ElementTypeNone is returned when end of list is reached
  84.  
  85. ;
  86. ; extern TQ3Status Q3Set_GetNextElementType(TQ3SetObject theSet, TQ3ElementType *theType)
  87. ;
  88.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  89.         IMPORT_CFM_FUNCTION Q3Set_GetNextElementType
  90.     ENDIF
  91.  
  92.  
  93. ; ******************************************************************************
  94. ; **                                                                             **
  95. ; **                                Attribute Types                                 **
  96. ; **                                                                             **
  97. ; ****************************************************************************
  98.  
  99. ;  
  100. ; *    For the data types listed below, pass in a pointer to it in the _Add 
  101. ; *    and _Get calls.
  102. ; *
  103. ; *    For surface shader attributes, reference counts are incremented on 
  104. ; *    the _Add and _Get 
  105.  
  106.  
  107. ; typedef long                            TQ3AttributeTypes
  108.                                                             ; Data Type                
  109. kQ3AttributeTypeNone            EQU        0                    ; ---------                
  110. kQ3AttributeTypeSurfaceUV        EQU        1                    ; TQ3Param2D                
  111. kQ3AttributeTypeShadingUV        EQU        2                    ; TQ3Param2D                 
  112. kQ3AttributeTypeNormal            EQU        3                    ; TQ3Vector3D                 
  113. kQ3AttributeTypeAmbientCoefficient EQU    4                    ; float                     
  114. kQ3AttributeTypeDiffuseColor    EQU        5                    ; TQ3ColorRGB                
  115. kQ3AttributeTypeSpecularColor    EQU        6                    ; TQ3ColorRGB                
  116. kQ3AttributeTypeSpecularControl    EQU        7                    ; float                    
  117. kQ3AttributeTypeTransparencyColor EQU    8                    ; TQ3ColorRGB                
  118. kQ3AttributeTypeSurfaceTangent    EQU        9                    ; TQ3Tangent2D              
  119. kQ3AttributeTypeHighlightState    EQU        10                    ; TQ3Switch                 
  120. kQ3AttributeTypeSurfaceShader    EQU        11                    ; TQ3SurfaceShaderObject    
  121. kQ3AttributeTypeNumTypes        EQU        12
  122. ; typedef TQ3ElementType                 TQ3AttributeType
  123.  
  124. ; ******************************************************************************
  125. ; **                                                                             **
  126. ; **                                Attribute Drawing                             **
  127. ; **                                                                             **
  128. ; ****************************************************************************
  129.  
  130. ;
  131. ; extern TQ3Status Q3Attribute_Submit(TQ3AttributeType attributeType, const void *data, TQ3ViewObject view)
  132. ;
  133.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  134.         IMPORT_CFM_FUNCTION Q3Attribute_Submit
  135.     ENDIF
  136.  
  137.  
  138. ; ******************************************************************************
  139. ; **                                                                             **
  140. ; **                            AttributeSet Routines                             **
  141. ; **                                                                             **
  142. ; ****************************************************************************
  143.  
  144. ;
  145. ; extern TQ3AttributeSet Q3AttributeSet_New(void )
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION Q3AttributeSet_New
  149.     ENDIF
  150.  
  151. ;
  152. ; extern TQ3Status Q3AttributeSet_Add(TQ3AttributeSet attributeSet, TQ3AttributeType theType, const void *data)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION Q3AttributeSet_Add
  156.     ENDIF
  157.  
  158. ;
  159. ; extern TQ3Boolean Q3AttributeSet_Contains(TQ3AttributeSet attributeSet, TQ3AttributeType attributeType)
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  162.         IMPORT_CFM_FUNCTION Q3AttributeSet_Contains
  163.     ENDIF
  164.  
  165. ;
  166. ; extern TQ3Status Q3AttributeSet_Get(TQ3AttributeSet attributeSet, TQ3AttributeType theType, void *data)
  167. ;
  168.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  169.         IMPORT_CFM_FUNCTION Q3AttributeSet_Get
  170.     ENDIF
  171.  
  172. ;
  173. ; extern TQ3Status Q3AttributeSet_Clear(TQ3AttributeSet attributeSet, TQ3AttributeType theType)
  174. ;
  175.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  176.         IMPORT_CFM_FUNCTION Q3AttributeSet_Clear
  177.     ENDIF
  178.  
  179. ;
  180. ; extern TQ3Status Q3AttributeSet_Empty(TQ3AttributeSet target)
  181. ;
  182.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  183.         IMPORT_CFM_FUNCTION Q3AttributeSet_Empty
  184.     ENDIF
  185.  
  186. ; * Q3AttributeSet_GetNextAttributeType
  187. ; *
  188. ; * Pass in kQ3AttributeTypeNone to get first type
  189. ; * kQ3AttributeTypeNone is returned when end of list is reached
  190.  
  191. ;
  192. ; extern TQ3Status Q3AttributeSet_GetNextAttributeType(TQ3AttributeSet source, TQ3AttributeType *theType)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION Q3AttributeSet_GetNextAttributeType
  196.     ENDIF
  197.  
  198. ;
  199. ; extern TQ3Status Q3AttributeSet_Submit(TQ3AttributeSet attributeSet, TQ3ViewObject view)
  200. ;
  201.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  202.         IMPORT_CFM_FUNCTION Q3AttributeSet_Submit
  203.     ENDIF
  204.  
  205. ; * Inherit from parent->child into result
  206. ; *    Result attributes are:
  207. ; *        all child attributes + all parent attributes NOT in the child
  208.  
  209. ;
  210. ; extern TQ3Status Q3AttributeSet_Inherit(TQ3AttributeSet parent, TQ3AttributeSet child, TQ3AttributeSet result)
  211. ;
  212.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  213.         IMPORT_CFM_FUNCTION Q3AttributeSet_Inherit
  214.     ENDIF
  215.  
  216.  
  217. ; ******************************************************************************
  218. ; **                                                                             **
  219. ; **                            Custom Element Registration                         **
  220. ; **                                                                             **
  221. ; ****************************************************************************
  222.  
  223. ; * Element Methods - 
  224. ; *
  225. ; *         When you create a custom element, you control what structures are 
  226. ; *        passed around the API. For example, you may allow the Q3Set_Add call 
  227. ; *        take one type of argument, store your element internally in some 
  228. ; *        abstract data type, and have the Q3Set_Get call take a different 
  229. ; *        argument.
  230. ; *
  231. ; *        For example:
  232. ; *            
  233. ; *        There are four calls which at some point will copy an element:
  234. ; *
  235. ; *        Q3Set_Add (copied from Application memory to QuickDraw3D memory)
  236. ; *        Q3Set_Get (copied from QuickDraw3D memory to Application memory)
  237. ; *        Q3Object_Duplicate (all elements are copied internally)
  238. ; *        Q3AttributeSet_Inherit (all elements are copied internally)
  239. ; *
  240. ; *         Either CopyAdd or CopyReplace is called during the "_Add" call.
  241. ; *            - CopyAdd is destructive and should assume "toElement" is garbage
  242. ; *            - CopyReplace is replacing an existing element.
  243. ; *
  244. ; *         CopyGet is called during the "_Get" call.
  245. ; *
  246. ; *         CopyDuplicate is called to duplicate an element's internal structure.
  247. ; *
  248. ; * Attributes Methods - 
  249. ; *
  250. ; *        For copying data while Inheriting. Element methods are used
  251. ; *        at all other times.
  252. ; *    
  253. ; *         CopyInherit is called to duplicate an element's internal structure 
  254. ; *            during inheritance. You should make this as fast as possible.
  255. ; *            (for example, if your custom element contains objects, you
  256. ; *             should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
  257. ; *            
  258. ; *        The ElementDelete method will be called for all of your elements 
  259. ; *        copied around via CopyAdd, CopyReplace, CopyDuplicate, and 
  260. ; *        CopyInherit.
  261. ; *        If CopyGet allocates any memory in it's destination, it is up to the 
  262. ; *        application to delete it on its side.
  263.  
  264.  
  265. kQ3XMethodTypeElementCopyAdd    EQU        'ecpa'
  266. kQ3XMethodTypeElementCopyReplace EQU    'ecpr'
  267. kQ3XMethodTypeElementCopyGet    EQU        'ecpg'
  268. kQ3XMethodTypeElementCopyDuplicate EQU    'eccd'
  269. kQ3XMethodTypeElementDelete        EQU        'ecpl'
  270. ;
  271. ; extern TQ3XObjectClass Q3XElementClass_Register(TQ3ElementType *elementType, const char *name, unsigned long sizeOfElement, TQ3XMetaHandler metaHandler)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  274.         IMPORT_CFM_FUNCTION Q3XElementClass_Register
  275.     ENDIF
  276.  
  277. ;
  278. ; extern TQ3Status Q3XElementType_GetElementSize(TQ3ElementType elementType, unsigned long *sizeOfElement)
  279. ;
  280.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION Q3XElementType_GetElementSize
  282.     ENDIF
  283.  
  284.  
  285. ; ******************************************************************************
  286. ; **                                                                             **
  287. ; **                        Custom Attribute Registration                         **
  288. ; **                                                                             **
  289. ; ****************************************************************************
  290.  
  291. ; typedef TQ3Boolean                     TQ3XAttributeInheritMethod
  292.  
  293. ;  return kQ3True or kQ3False in your metahandler 
  294. ;
  295. ; extern TQ3XObjectClass Q3XAttributeClass_Register(TQ3AttributeType *attributeType, const char *creatorName, unsigned long sizeOfElement, TQ3XMetaHandler metaHandler)
  296. ;
  297.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION Q3XAttributeClass_Register
  299.     ENDIF
  300.  
  301. ; *    Version 1.5
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.     ENDIF ; __QD3DSET__ 
  310.  
  311.